package com.synjones.wschool.face.mapper;

import com.synjones.wschool.face.domain.FileStorage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface FileStorageMapper {
    int deleteByPrimaryKey(Long sid);

    int insert(FileStorage record);

    int insertSelective(FileStorage record);

    FileStorage selectByPrimaryKey(Long sid);

    int updateByPrimaryKeySelective(FileStorage record);

    int updateByPrimaryKey(FileStorage record);

    List<FileStorage> selectSelective(FileStorage fileStorage);

    List<FileStorage> findByIdListAndType(@Param("list") List<Long> sourceIds, @Param("fileSourceType") Integer sourceType);

    List<FileStorage> queryBySourceIdAndType(@Param("fileSourceId") Long fileSourceId, @Param("fileSourceType") Integer fileSourceType);

    /**
     * 批量删除
     * @param idList fileSourceId 集合
     * @param  fileSourceType
     * @return
     */
    Integer deleteIdListAndType(@Param("list") List<Long> idList, @Param("fileSourceType") Integer fileSourceType);

    /**
     * 批量插入fileStorage
     * @param fileStorages
     */
    Integer batchSavePicture(@Param("list") List<FileStorage> fileStorages);

    /**
     * 根据主键集合删除fileStorage
     * @param deleFileList
     */
    Integer deleteBySids(@Param("list") List<Long> deleFileList);

    Integer deleteSourceIdAndType(@Param("sourceId") Long sourceId, @Param("typeId") int i);


    FileStorage getBySourceIdType(@Param("fileSourceId") Long fileSourceId, @Param("fileSourceType") int fileSourceType);

    int deleteFileStorage(FileStorage fileStorage);

    List<FileStorage> queryList(@Param("list") List<Long> fileStorageIds);

    int addFileStorageList(@Param("list") List<FileStorage> fileStorageList);


    List<FileStorage> findHomeworkListAndSourceType(@Param("fileSourceId") Long homeworkId, @Param("fileSourceType") Integer sourceId);
}